////
////  HXFriendListViewController.m
////  NewProject
////
////  Created by Livespro on 2017/5/3.
////  Copyright © 2017年 FZ. All rights reserved.
////
//
//#import "HXFriendListViewController.h"
//
//#import "HXChatMessageViewController.h"
//
//@interface HXFriendListViewController ()<EMUserListViewControllerDataSource,EMUserListViewControllerDelegate>
//
//@property (nonatomic, strong)  EaseUsersListViewController *listVC;
//
//@property (nonatomic, strong)  UITableView *friendListTable;
//
//@property (nonatomic, strong)  UIButton *addBtn;
//
//@end
//
//@implementation HXFriendListViewController
//
//- (void)viewDidLoad {
//    [super viewDidLoad];
//    // Do any additional setup after loading the view.
//    
//}
//
//- (void)staticViewsWithoutNib{
//    
//    self.naviStand.title = @"FriendList";
//    
//    [self.view addSubview:self.listVC.view];
//    [self addChildViewController:self.listVC];
//    
//    [self.naviStand.rightButtons addObject:self.addBtn];
//    self.addBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -20);
//    
//}
//
//#pragma mark - lazyLoad
//
//- (UIButton *)addBtn{
//    
//    if (!_addBtn) {
//        
//        _addBtn = [UIButton buttonWithCustomTypeNomalImage:@"add_friend" Frame:CGRectMake(0, 0, 44, 44)];
//        [_addBtn setImage:[[UIImage imageNamed:@"add_friend"] rt_tintedImageWithColor:Colorfff] forState:UIControlStateNormal];
//        
//        [_addBtn addTarget:self action:@selector(addFriendAction) forControlEvents:UIControlEventTouchUpInside];
//    }
//    
//    return _addBtn;
//}
//
//- (EaseUsersListViewController *)listVC{
//    
//    if (!_listVC) {
//        
//        _listVC = [[EaseUsersListViewController alloc] init];
//        _listVC.view.frame = CGRectMake(0, 64, kScreenWidth, kScreenHeight - 64);
//        _listVC.showRefreshHeader = YES;
////        _listVC.showSearchBar = YES;
//        
//        _listVC.dataSource = self;
//        _listVC.delegate = self;
//    }
//    return _listVC;
//}
//
//- (void)addFriendAction{
//
//    __weak typeof(self) weakSelf = self;
//    AlertBlockCustom *alert = [[AlertBlockCustom alloc]initWithTitle:@"" message:@"添加好友" cancelButtonTitle:@"取消" clickBlockAction:^(AlertBlockCustom *alertView, NSInteger buttonIndex) {
//        
//        if (buttonIndex == 1) {
//        
//            EMError *error = [[EMClient sharedClient].contactManager addContact:alertView.textField.text message:@""];
//            if (!error) {
//                
//                [weakSelf.listVC tableViewDidTriggerHeaderRefresh];
//                NSLog(@"添加成功");
//            }
//            
//        }
//        
//    } otherButtonTitles:@"确定", nil];
//    
//    alert.alertStyle = AlertStylePlainTextInput;
//    alert.contentAlignment = NSTextAlignmentCenter;
//    alert.cancelTitleColor = Colorccc;
//    
//    [alert show];
//    
//}
//
////联系人列表扩展样例
//- (id<IUserModel>)userListViewController:(EaseUsersListViewController *)userListViewController
//                           modelForBuddy:(NSString *)buddy
//{
//    //用户可以根据自己的用户体系，根据buddy设置用户昵称和头像
//    id<IUserModel> model = nil;
//    model = [[EaseUserModel alloc] initWithBuddy:buddy];
//    model.avatarURLPath = nil;//头像网络地址
//    model.nickname = nil;//用户昵称
//    return model;
//}
//
///*!
// @method
// @brief 点击好友列表中某一好友的回调
// @discussion 点击好友列表的好友userModel，自行处理点击后的业务
// @param userListViewController  当前好友列表视图
// @param userModel               用户模型
// */
//- (void)userListViewController:(EaseUsersListViewController *)userListViewController
//            didSelectUserModel:(id<IUserModel>)userModel;{
//    
//    HXChatMessageViewController *chatMessage = [[HXChatMessageViewController alloc]init];
//    
//    chatMessage.userModel = userModel;
//    
//    [self.navigationController pushViewController:chatMessage animated:YES];
//    
//}
//
//@end

